/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.webfis.modelos;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author silvio
 */
@Entity
@Table(name = "formacao")
@NamedQueries({
    @NamedQuery(name = "Formacao.findAll", query = "SELECT f FROM Formacao f")})
public class Formacao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_formacao")
    private Integer idFormacao;
    @Basic(optional = false)
    @Column(name = "formacao")
    private String formacao;
    @OneToMany(mappedBy = "idFormacao")
    private Collection<Servidores> servidoresCollection;

    public Formacao() {
    }

    public Formacao(Integer idFormacao) {
        this.idFormacao = idFormacao;
    }

    public Formacao(Integer idFormacao, String formacao) {
        this.idFormacao = idFormacao;
        this.formacao = formacao;
    }

    public Integer getIdFormacao() {
        return idFormacao;
    }

    public void setIdFormacao(Integer idFormacao) {
        this.idFormacao = idFormacao;
    }

    public String getFormacao() {
        return formacao;
    }

    public void setFormacao(String formacao) {
        this.formacao = formacao;
    }

    public Collection<Servidores> getServidoresCollection() {
        return servidoresCollection;
    }

    public void setServidoresCollection(Collection<Servidores> servidoresCollection) {
        this.servidoresCollection = servidoresCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idFormacao != null ? idFormacao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Formacao)) {
            return false;
        }
        Formacao other = (Formacao) object;
        if ((this.idFormacao == null && other.idFormacao != null) || (this.idFormacao != null && !this.idFormacao.equals(other.idFormacao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.webfis.modelos.Formacao[ idFormacao=" + idFormacao + " ]";
    }
    
}
